package com.huike.clues.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.dto.TbClueDTO;
import com.huike.clues.domain.vo.TbClueVo;
import com.huike.clues.mapper.TbClueMapper;
import com.huike.clues.service.TbClueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 93238
 * @description 针对表【tb_clue(线索)】的数据库操作Service实现
 * @createDate 2023-10-12 06:35:46
 */
@Service
public class TbClueServiceImpl extends ServiceImpl<TbClueMapper, TbClue> implements TbClueService {

    @Autowired
    private TbClueMapper clueMapper;

    /**
     * 新增线索管理
     *
     * @param dto 新增线索信息
     */
    @Override
    public void add(TbClueDTO dto) {
        TbClue bean = BeanUtil.toBean(dto, TbClue.class);
        this.save(bean);
    }

    /**
     * 分页查询
     *
     * @param dto 查询条件
     * @return 查询结果
     */
    @Override
    public List<TbClueVo> pageList(TbClueDTO dto) {

        List<TbClueVo> clueList  = clueMapper.pageList(dto);

        return clueList;
    }
}




